extends CharacterBody2D


var playerEntered = false
var shopItems;


func _ready():
	shopItems = {
		"ironRod": 100,
		"gun": 500
	}


func _process(delta):
	if Input.is_action_just_pressed("Interect") and playerEntered:
		showWeaponShop()


func _on_interect_area_body_entered(body):
	if body.is_in_group("Player"):
		playerEntered = true


func _on_interect_area_body_exited(body):
	if body.is_in_group("Player"):
		playerEntered = false
		
		
func showWeaponShop():
	GlobalSignal.showWeaponShop.emit(shopItems, self)
		
		
